<%@page contentType="text/html; charset=UTF-8"%>
<%@page import="com.cndatacom.oa.voting.been.*" %>
<%@page import="com.cndatacom.oa.voting.VotingManagerUtils" %>
<%@page import="java.util.*" %>
<%@page import="java.sql.Timestamp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>北京研究院第九届（春季花卉）摄影比赛</title>
<link href="jx.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.STYLE1 {
	font-size: 12px;
	font-weight: bold;
}
-->
</style>
</head>

<% 
	String targetMatchNo = "20110426";//比赛编号
	long loginUserId = 1;//当前用户的ID，用于记录投票状况
	
	VoteMatch vMatch = VotingManagerUtils.getVoteMatchInfo(targetMatchNo);//比赛信息
	String startTime = vMatch.getVoteStartTime().toString().substring(0,16);
	String endTime = vMatch.getVoteEndTime().toString().substring(0,16);
	
	int votedUserCount = VotingManagerUtils.getVotedUserCount(targetMatchNo);
	int votedPicSum = VotingManagerUtils.getAllVotedSum(targetMatchNo);
	
	java.util.List list = VotingManagerUtils.getAllVotePicInfo(targetMatchNo);//比赛作品列表
	if(list == null) {
		list = new ArrayList();
	}
	
%>

<body class="text_body">
 <div class="jx_topBox2"><img src="images/banner.jpg" width="960" height="160" /></div>
 <div class="jx_toptitle3">投票时间：<%=startTime %>至<%=endTime %></div>
 <div class="md_bd">

  <div class="mb_bd">
    
<%
	for(int i=0; i<list.size(); i++) {
		VotePic votePic = (VotePic)list.get(i);
		String picTitle = votePic.getPicTitle();
		String picTitleShort = "";
		String picAuthodName = votePic.getAuthodName();
		String picNo = votePic.getPicNo();
		int nVotedSum = votePic.getVoteSum();
		double fSum = Math.round((double)nVotedSum/(double)votedPicSum * 100)/1.0;
		double fWidth = 1.9 * fSum;
			
		if(picTitle != null) {
			if(picTitle.length()>14) {
				picTitleShort = picTitle.substring(0,14)+"..";
			}else {
				picTitleShort = picTitle;
			}
		}else {
			picTitle = "";
		}
		if(picAuthodName == null) {
			picAuthodName = "";
		}
		if(picNo == null) {
			picNo = "";
		}
%>	
	<table class="vote_data" border="0" cellspacing="1" width="100%">
      <tbody>
        <tr class="data_row_01">
          <td class="sort_number" width="35"><table border="0" width="100%">
            <tbody>
              <tr>
                <td><%=i+1 %></td>
              </tr>
            </tbody>
          </table></td>
          <td class="data_desc"><table border="0" width="100%">
            <tbody>
              <tr>
                <td title="<%=picTitle%>"><%=picNo%>-<%=picTitleShort%>-<%=picAuthodName%></td>
              </tr>
            </tbody>
          </table></td>
          <td class="data" width="253"><table border="0" width="100%">
            <tbody>
              <tr>
                <td><span class="vote_numb vote_numb_0-20" style="width: <%=fWidth %>px;"><b></b></span><%=fSum%>%</td>
              </tr>
            </tbody>
          </table></td>
          <td class="data_numb_2" width="76"><table border="0" width="100%">
            <tbody>
              <tr>
                <td><%=nVotedSum %>票</td>
              </tr>
            </tbody>
          </table></td>
        </tr>
      </tbody>
    </table>
<%
	} 
%> 
	
    </div>
  <div class="hd">总票数：<%=votedPicSum%>票 &nbsp; &nbsp; &nbsp;投票人数：<%=votedUserCount%>人</div>
</div>
<div class="jx_ballotBottom"><a href="javascript:window.open('','_parent','');window.close();"><img src="images/close.gif"/></a></div>
<div class="jx_bg">
<div class="jx_BottomBox">中国电信北京研究院  版权所有</div>
</div>
</body>
</html>